#!/usr/bin/python
# coding=utf-8

total = 0
total_inv = 0
MAX_YEARS = 40

for i in range(0, MAX_YEARS):
    # 假设烟钱每年涨2%
    tmp_inv = 0.5 * (1 + i * 0.02)
    total_inv += tmp_inv
    for j in range(0, MAX_YEARS - i):
        # 假设投资年化收益10%
        tmp_inv = tmp_inv * (1 + 0.1)
    total += tmp_inv
    #print(f'{i}----{total_inv}----{total}')
print(f'\n{total_inv}----{total}')
